import React, {Component, PropTypes} from 'react'
import {Menu, Icon, Layout } from 'antd'
// import 'antd/dist/antd.css';
import Slide from 'react-slick'
import {Link} from 'react-router'

const SubMenu = Menu.SubMenu;
const MenuItemGroup = Menu.ItemGroup;
const {Header, Footer, Sider, Content} = Layout;

class Adminlet extends Component {
    constructor(props) {
        super(props);
        this.state = {
            current: 'mail',
        };
    }

    handleClick = (e) => {
        console.log('click ', e);
        this.setState({
            current: e.key,
        });
    }
    // componentDidMount() {
    //   apiInfo({path: '/v1/goods/'+this.props.params.id+'/detail', method: 'get'}).then((data) => {
    //        this.setState({
    //          slide:data.imgsList,
    //          info:{
    // 			  "name":data.goodsName,
    // 			  "desc":data.desc,
    // 			  "salepoint":store.get("integralValue"),
    // 			  "realprice":store.get("price"),
    // 			  "price":store.get("amount"),
    // 			  "status":store.get("status"),
    // 			  "leftNum":store.get("leftNum"),
    // 			  "startDate":store.get("startDate")
    // 		  }
    //        });
    //    })
    // }
    // buy(){
    // 	//判断是否积分是否够用，如果不够用则不能购买
    // 	console.log(123123);
    // 	if(this.state.info.point<300){
    // 		this.refs.modal.style.display="block";
    // 	}else{
    // 		this.props.history.push("/detail/"+this.props.params.id+"/clear");
    // 	}
    // }
    // cancel(){
    // 	this.refs.modal.style.display="none";
    // }
    // gobuy(){
    // 	this.props.history.replace("/detail/"+this.props.params.id+"/clear");
    // }
    // renderBtn(status,num){
    // 	if(num==0){
    // 		return 	(<section className="product-btn">
    // 				<a  className="disabled" onClick={this.buy.bind(this)}>已售罄</a>
    // 			</section>)
    // 	}
    // 	if(status==3){
    // 			return 	(<section className="product-btn">
    // 				<a onClick={this.buy.bind(this)}>立即购买</a>
    // 			</section>)
    // 	}else if(status==2){
    // 		return	(<section className="product-btn">
    // 				<a  className="disabled" onClick={this.buy.bind(this)}>{this.state.info.startDate}</a>
    // 			</section>)
    // 	}else if(status==4){
    // 			return	(<section className="product-btn">
    // 				<a  className="disabled" onClick={this.buy.bind(this)}>已结束</a>
    // 			</section>)
    // 	}
    //
    // }
    render() {
        return (
            <Layout>

                <Header>
                    <Menu
                        onClick={this.handleClick}
                        selectedKeys={[this.state.current]}
                        mode="horizontal"
                    >
                        <Menu.Item key="usermanger">
                            <Icon type="user"/>用户管理
                        </Menu.Item>
                        <Menu.Item key="integralmanger" >
                            <Icon type="appstore"/>积分管理
                        </Menu.Item>
                        <Menu.Item key="integralrecord">
                            <Link to="adminlet/" ><Icon type="bars"/>中奖记录</Link>
                        </Menu.Item>
                        <Menu.Item key="prizemanger">
                            <Link to="/adminlet/prizemanger">奖品管理</Link>
                        </Menu.Item>
                        <Menu.Item key="integraltoprize">
                            <a >积分抽奖</a>
                        </Menu.Item>
                        <Menu.Item key="integralchange">
                            <Link to="/adminlet/integralexchange"><Icon type="shopping-cart"/>积分兑换</Link>
                        </Menu.Item>
                        <Menu.Item key="integralgame">
                            <a >积分撞球</a>
                        </Menu.Item>
                    </Menu>
                </Header>

                <Content>{this.props.children}</Content>
            </Layout>
        );
    }
}

export default Adminlet